<?php
	 global $base_url,$language;
    $url = $base_url . '/' . drupal_get_path('module', 'employment');
	$Path = drupal_get_path('module', 'employment');
//print_r($language);
//print "<pre>";print_r($items); print"</pre>";
$i=0;
?>
<div class="view-header" id="viewmod_job_opportunity">
<div class="inner_tab_content">
    <div class="inner_li">
        <a class="view_head_sel active" href="<?php echo $base_url; ?>">Jobs</a>
    </div>
</div>

<div class='result_inner'>

<div class="res_dept"><span><?php print t('Job Opportunities in Government Departments'); ?>
</span></div>
<span  class="backch"><a href="../deptname"></a></span>

<?php
foreach($items as $row){

    $job_url = $row->field_url['und'][0]['value'];
    $file=$row->field_docupload['und'][0]['filesize'];
    $photo=$row->field_docupload['und'][0]['uri'];

    if(empty($row->field__upload_file['und'][0]['uri'])) {
    	$icon ='';
    	$filepath = $row->field_url['und'][0]['value'];
    	$kbyte = '';
    }
    else {
     	$icon ='<img alt="Download Icon" src="http://cms.tn.gov.in/sites/default/files/icons/pdf_icon.gif">';
        $link = $row->field__upload_file['und'][0]['uri'];
    			$wrapper = file_stream_wrapper_get_instance_by_uri($link);
    	if($wrapper == true){
    		 $filepath = $wrapper->getDirectoryPath() . "/" . file_uri_target($link);
    	}
    	$filepath="http://cms.tn.gov.in/tncms_latest/$filepath";
        if ($row->field__upload_file['und'][0]['filesize'] != '0') {
    		$kb = ceil($row->field__upload_file['und'][0]['filesize']/1024);
    		$kbyte= $kb.KB;
    		if($kb >1024) {
    			$kb = ceil($kb/1024);
    			$kbyte= $kb.MB;
    		}
       }
    }

	     ?>

		<div class="acitizench">
          <a class="iconcitizen" href='javascript:void(0);' onclick='return tnportal_window("<?php echo $filepath; ?>");'>
          <?php print ucfirst($row->title).$icon;?></a>&nbsp;&nbsp;<?php if($kbyte) { ?><span>(<?php echo $kbyte; ?>)</span> <?php }?>

        </div>


<?php  $i++;?>
<?php }  ?>
<?php  ?>
	<?php if($i == '0'){  	 ?>
	<div class="no_record">	No Record Found </div>
	<?php
	}?>
	<div class='clr'></div>
	</div>
	</div>




